import { Session } from '/@/utils/storage';
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  indexWidth: '60',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 6,
  labelWidth: '160',
  columnBtn: false,
  editBtn:false,
  delBtn:false,
  selection: true,
  searchEnter:true,
  searchLabelWidth: 'auto',
  searchMenuPosition: 'left',
  menuWidth:210,
  column: [
    // {
    //   "type": "input",
    //   "label": "主键",
    //   "prop": "orId",
    //   "addDisplay": false,
    //   "editDisabled": true
    // },
    {
      type: 'input',
      label: '工单编号',
      prop: 'orderNo',
      overHidden: true,
      width: 150,
      addDisplay: false,
      editDisabled: true,
      // color: 'blue',
      search: true
    },

    {
      type: 'input',
      label: '事件编号',
      prop: 'eventNo',
      overHidden: true,
      width: 150,
      addDisplay: false,
      editDisabled: true,
      search: true
    },
    {
      type: 'select',
      label: '报修类型', //硬件更换、上门维修
      prop: 'orderType',
      search: true,
      dicUrl: '/api/admin/omodict/item/select?dictKey=event_type',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      width: 130
    },
    {
      type: 'input',
      label: '工单名称',
      prop: 'orderName',
      overHidden: true,
      width: 220,
      rules: [
        {
          required: true,
          message: '请输入工单名称',
          trigger: 'blur'
        }
      ]
    },
    {
      type: 'select',
      label: '工单来源',
      prop: 'orderFrom',
      dicUrl: '/api/admin/omodict/item/select?dictKey=event_from',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      width: 150
    },
    {
      type: 'select',
      label: '优先等级',
      prop: 'priorityLevel',
      dicUrl: '/api/admin/omodict/item/select?dictKey=event_level',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      width: 130,
      search: true
    },
    {
      // type: 'input',
      label: '设备名称',
      prop: 'equipName',
      overHidden: true,
      width: 230
      // hide: true
    },

    {
      type: 'input',
      label: '设备编号',
      prop: 'equipNo',
      width: 150,
      addDisabled: true,
      editDisabled: true,
      overHidden: true,
      hide: true
    },

    // {
    //   "type": "input",
    //   "label": "报修人ID",
    //   "prop": "orderUserId"
    // },
    {
      type: 'tree',
      label: '报修人部门',
      prop: 'orderUserDeptId',
      filterable: true,
      // editDisplay: false,
      width: 150,
      props: {
        label: 'name',
        value: 'id'
      },
      cascader: ['orderUserId'],
      dicUrl: `/api/admin/dept/tree`,
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      hide: true
    },
    {
      type: 'select',
      label: '报修人',
      prop: 'orderUserId',
      props: {
        label: 'name',
        value: 'userId'
      },
      dicUrl: `/api/admin/user/page/?deptId={{key}}`,
      dicFormatter: (data) => {
        return data.data.records
      },
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
    },
    {
      type: 'input',
      label: '报修人电话',
      prop: 'orderUserPhone',
      rules: [
        {
          pattern: /^1[3456789]\d{9}$/,
          message: '请输入正确手机号',
          trigger: 'blur'
        }
      ],
      width: 150,
      hide: true
    },
    {
      type: 'select',
      label: '故障等级',
      prop: 'faultLevel',
      formslot: true,
      dicUrl: '/api/admin/omodict/item/select?dictKey=fault_level',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      width: 150,
      search: true,
      hide: true
    },

    {
      // type: "input",
      label: '报修区域',
      prop: 'equipArea',
      width: 150,
      hide: true,
      overHidden: true
      // rules: [
      //   {
      //     required: true,
      //     message: '请选择区域',
      //     trigger: 'blur'
      //   }
      // ]
    },
    // {
    //   label: '公司名称',
    //   prop: 'companyName',
    //   width: 150,
    //   search: true,
    //   overHidden: true
    // },
    // {
    //   label: '房间号',
    //   prop: 'roomNum',
    //   width: 150,
    //   search: true,
    //   overHidden: true
    // },
    {
      type: 'select',
      label: '工单状态',
      prop: 'orderStatus',
      width: 150,
      dicUrl: '/api/admin/omodict/item/select?dictKey=order_status',
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      props: {
        label: 'label',
        value: 'value'
      },
      formslot: true,
      search: true,
      addDisplay: false,
      editDisabled: true,
      addDisabled: true
    },

    {
      type: 'textarea',
      label: '报修说明',
      prop: 'applyContent',
      width: 150,
      overHidden: true,
      minRows: 2,
      span: 24
    },
    {
      // type: 'upload',
      label: '上传图片',
      prop: 'fileList',
      hide: true,
      dataType: 'array',
      span: 24
    },
    {
      // type: 'datetime',
      label: '维修方式',
      prop: 'appointTime',
      hide: true,
      width: 180,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      span: 24
    },
    {
      label: '派单方式',
      prop: 'appointType',
      hide: true,
      span: 24
    },
    {
      type: 'date',
      label: '报修时间',
      prop: 'applyTime',
      width: 180,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      addDisplay: false,
      editDisabled: true
    },
    // {
    //   type: 'tree',
    //   label: '设备栏目',
    //   prop: 'assetsType',
    //   filterable: true,
    //   hide: true,
    //   dicUrl: `/bm/bamaassetscloumn/fullTreeMenu?lazy=true&level=1`,
    //   props: {
    //     label: 'name',
    //     value: 'id'
    //   },
    //   width: 150,
    //   overHidden: true,
    //   editDisplay: false
    // },
    // {
    //   label: '设备类型',
    //   prop: 'modelType',
    //   hide: true,
    //   editDisplay: false,
    //   width: 150
    // },
    // {
    //   label: '设备型号',
    //   prop: 'devType',
    //   hide: true,
    //   editDisplay: false,
    //   width: 150
    // },
    // {
    //   label: '设备名称',
    //   prop: 'equipId',
    //   editDisplay: false,
    //   editDisabled: true,
    //   hide: true
    // },

    // {
    //   "type": "input",
    //   "label": "处理人员",
    //   "prop": "handleUserId"
    // },
    {
      type: 'tree',
      label: '处理人部门',
      prop: 'handleUserDeptId',
      filterable: true,
      addDisplay: false,
      editDisplay: false,
      width: 150,
      props: {
        label: 'name',
        value: 'id'
      },
      cascader: ['handleUserId'],
      dicUrl: `/api/admin/dept/tree`,
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      hide: true
    },
    {
      type: 'select',
      label: '处理人',
      prop: 'handleUserId',
      addDisplay: false,
      editDisplay: false,
      props: {
        label: 'name',
        value: 'userId'
      },
      dicUrl: `/api/admin/user/userswithdept/{{key}}`,
      dicHeaders: {
        authorization: 'Bearer ' + Session.get('token'),
      },
      hide: true
      // addDisplay: false,
      // editDisplay: false,
      // addDisabled: true
      // editDisabled: true
    },
    {
      type: 'input',
      label: '处理人',
      prop: 'handleUserName',
      width: 150,
      hide: true,
      // addDisabled: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: true
    },
    {
      type: 'input',
      label: '处理人电话',
      prop: 'handleUserPhone',
      addDisplay: false,
      editDisplay: false,
      rules: [
        {
          pattern: /^1[3456789]\d{9}$/,
          message: '请输入正确手机号',
          trigger: 'blur'
        }
      ],
      width: 150,
      hide: true
      // addDisabled: true,
      // editDisabled: true
    },
    {
      type: 'input',
      label: '处理时间',
      prop: 'handleTime',
      width: 150,
      overHidden: true,
      addDisplay: false,
      editDisplay: false,
      editDisabled: true,
      addDisabled: true
    },

    {
      type: 'textarea',
      label: '处理备注',
      prop: 'remark',
      addDisplay: false,
      editDisplay: false,
      width: 150,
      overHidden: true,
      span: 24
    }
  ]
}
